package com.models
{
	import com.events.AppEvent;
	
	import flash.display.Stage;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	public class AppModel extends EventDispatcher
	{
		private var _theStage:Stage;
		//
		private var _id:Number = -1;
		private var _popupID:Number;
		//
		private var _popupXML:XMLList;
		
		public function AppModel($stage:Stage)
		{
			_theStage = $stage;
		}
		public function get theStage():Stage
		{
			return _theStage;
		}
		//----------------------------
		public function get id():Number
		{
			return _id;
		}

		public function set id(value:Number):void
		{
			if(value == _id)
				return;
			
			_id = value;
			
			trace("AppModel.id = " + _id);
	
			dispatchEvent(new AppEvent(AppEvent.ID_CHANGE));
		}

		public function get popupID():Number
		{
			return _popupID;
		}

		public function set popupID(value:Number):void
		{
			_popupID = value;
			
			trace("AppModel.popupID = " + _popupID);
			
			dispatchEvent(new AppEvent(AppEvent.POPUP_ID_CHANGE));
			
		}
		//------------------------------
		public function get popupXML():XMLList
		{
			return _popupXML;
		}

		public function set popupXML(value:XMLList):void
		{
			_popupXML = value;
		}


	}
}